﻿using System.Runtime.Serialization;
using System.ServiceModel;
using Navigant.Common;

namespace Navigant.DataContracts
{
    [DataContract(Name = "CustodianContract", Namespace = ServiceConstants.DataContractNamespace)]
    [ServiceKnownType(typeof(CaseChildItemContract))]
    public class CustodianContract : CaseChildItemContract
    {
        #region Fields

        private string firstName;        
        private string middleName;        
        private string lastName;        
        private string email;        
        private bool isInternal;        
        private bool isPerson;
        private string status;

        #endregion

        #region Constructors

        public CustodianContract()
        {
            this.firstName = string.Empty;
            this.middleName = string.Empty;
            this.lastName = string.Empty;
            this.email = string.Empty;
            this.isInternal = false;
            this.isPerson = false;
            this.status = PreservationNoticeStatusContract.Unsent.ToString();
        }

        #endregion

        #region Properties

        [DataMember]
        public string FirstName
        {
            get { return this.firstName; }
            set 
            {
                if (!object.ReferenceEquals(this.firstName, value))
                {
                    this.firstName = value;
                    this.RaisePropertyChanged("FirstName");
                }
            }
        }

        [DataMember]
        public string MiddleName
        {
            get { return this.middleName; }
            set 
            {
                if (!object.ReferenceEquals(this.middleName, value))
                {
                    this.middleName = value;
                    this.RaisePropertyChanged("MiddleName");
                }
            }
        }

        [DataMember]
        public string LastName
        {
            get { return this.lastName; }
            set 
            {
                if (!object.ReferenceEquals(this.lastName, value))
                {
                    this.lastName = value;
                    this.RaisePropertyChanged("LastName");
                }
            }
        }

        [DataMember]
        public string Email
        {
            get { return this.email; }
            set 
            {
                if (!object.ReferenceEquals(this.email, value))
                {
                    this.email = value;
                    this.RaisePropertyChanged("Email");
                }
            }
        }

        [DataMember]
        public bool IsInternal
        {
            get { return this.isInternal; }
            set 
            {
                if (!object.ReferenceEquals(this.isInternal, value))
                {
                    this.isInternal = value;
                    this.RaisePropertyChanged("IsInternal");
                }
            }
        }

        [DataMember]
        public bool IsPerson
        {
            get { return this.isPerson; }
            set 
            {
                if (!object.ReferenceEquals(this.isPerson, value))
                {
                    this.isPerson = value;
                    this.RaisePropertyChanged("IsPerson");
                }
            }
        }

        [DataMember]
        public string Status
        {
            get { return this.status; }
            set
            {
                if (!object.ReferenceEquals(this.status, value))
                {
                    this.status = value;
                    this.RaisePropertyChanged("Status");
                }
            }
        }

        #endregion
    }
}
